﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Drawing;

namespace TheQuest
{
    class Mace: Weapon
    {
        public Mace(Game game, Point location)
            : base(game, location)
        {
            //no constructor
        }
        public override string Name
        {
            get { return "mace"; }
        }

        public override void Attack(Direction direction, Random random)
        {
            switch (direction)
            {
                case Direction.Up:
                    if (!DamageEnemy(Direction.Up, 20, 6, random))
                        if (!DamageEnemy(Direction.Left, 20, 6, random))
                            if(DamageEnemy(Direction.Down, 20, 6, random))
                               DamageEnemy(Direction.Right, 20, 6, random) ;
                    break;
                case Direction.Down:
                    if (!DamageEnemy(Direction.Down, 20, 6, random))
                        if (!DamageEnemy(Direction.Right, 20, 6, random))
                            if (DamageEnemy(Direction.Up, 20, 6, random))
                                DamageEnemy(Direction.Left, 20, 6, random);
                    break;
                case Direction.Left:
                    if (!DamageEnemy(Direction.Left, 20, 6, random))
                        if (!DamageEnemy(Direction.Down, 20, 6, random))
                            if (DamageEnemy(Direction.Right, 20, 6, random))
                                DamageEnemy(Direction.Up, 20, 6, random);
                    break;
                case Direction.Right:
                    if (!DamageEnemy(Direction.Right, 20, 6, random))
                        if (!DamageEnemy(Direction.Up, 20, 6, random))
                            if (DamageEnemy(Direction.Left, 20, 6, random))
                                DamageEnemy(Direction.Down, 20, 6, random);
                    break;
                default:
                    break;
            }
        }
    }
}
